package data;

/**
 * Abstract Class Building
 * 
 * Implements the basic outline of a building.
 * 
 * @author Stijn Verslycken, Jonas Van Den Bossche
 * @date 2007-2008
 */
public class Building {

    private int buildingId;
    private String name;
    private int level;
    private int maxLevel;
    private int timeLeft;
    private int[] cost = new int[5];
    private String statusDescription;
    private int villageId;
    private int locationX;
    private int locationY;
    private int capacity;
    private int strength;
    private String resourceType;
    private int type;
    private String imageUrl;

    public Building(){
    }
    /**
     * Constructor with all parameters.
     * 
     * @param buildingId
     * @param name
     * @param level
     * @param maxLevel 
     * @param timeLeft
     * @param cost
     * @param statusDescription 
     * @param villageId
     * @param locationX
     * @param locationY
     * @param capacity
     * @param strength
     * @param resourceType 
     * @param type
     */
    public Building(int buildingId, String name, int level, int maxLevel, int timeLeft, int[] cost, String statusDescription,
            int villageId, int locationX, int locationY, int capacity, int strength, String resourceType,
            int type, String imageUrl) {
        
        this.setBuildingId(buildingId);
        this.setName(name);
        this.setLevel(level);
        this.setMaxLevel(maxLevel);
        this.setTimeLeft(timeLeft);
        this.setCost(cost);
        this.setStatusDescription(statusDescription);
        this.setVillageId(villageId);
        this.setLocationX(locationX);
        this.setLocationY(locationY);
        this.setCapacity(capacity);
        this.setStrength(strength);
        this.setResourceType(resourceType);
        this.setType(type);
        this.setImageUrl(imageUrl);
        
    }
    
    /**
     * Constructor with all parameters, resources separated.
     * 
     * @param buildingId
     * @param name
     * @param level
     * @param maxLevel
     * @param timeLeft
     * @param foodCost
     * @param woodCost
     * @param stoneCost
     * @param ironCost
     * @param goldCost
     * @param statusDescription
     * @param villageId
     * @param locationX
     * @param locationY
     * @param capacity
     * @param strength
     * @param resourceType
     * @param type
     * @param imageUrl
     */
    public Building(int buildingId, String name, int level, int maxLevel, int timeLeft, int foodCost, int woodCost,
            int stoneCost, int ironCost, int goldCost, String statusDescription, int villageId, int locationX, 
            int locationY, int capacity, int strength, String resourceType, int type, String imageUrl) {
        
        this(buildingId, name, level, maxLevel, timeLeft, new int[]{foodCost, woodCost, stoneCost, ironCost, goldCost}, statusDescription, 
                villageId, locationX, locationY, capacity, strength, resourceType, type, imageUrl);        
    }
    
    /**
     * Constructor with al parameters but id.
     * 
     * @param name
     * @param level
     * @param maxLevel 
     * @param timeLeft
     * @param cost
     * @param statusDescription
     * @param villageId
     * @param locationX
     * @param locationY
     * @param capacity
     * @param strength
     * @param resourceType 
     * @param type
     * @param imageUrl 
     */
    public Building(String name, int level, int maxLevel, int timeLeft, int[] cost, String statusDescription,
            int villageId, int locationX, int locationY, int capacity, int strength, String resourceType,
            int type, String imageUrl) {
        
        this(0, name, level, maxLevel, timeLeft, cost, statusDescription, villageId, locationX, locationY, capacity,
                strength, resourceType, type, imageUrl);        
    }
    
    /**
     * Constructor with all parameters but id, resources separated.
     * 
     * @param buildingId
     * @param name
     * @param level
     * @param maxLevel
     * @param timeLeft
     * @param foodCost
     * @param woodCost
     * @param stoneCost
     * @param ironCost
     * @param goldCost
     * @param statusDescription
     * @param villageId
     * @param locationX
     * @param locationY
     * @param capacity
     * @param strength
     * @param resourceType
     * @param type
     * @param imageUrl
     */
    public Building(String name, int level, int maxLevel, int timeLeft, int foodCost, int woodCost, int stoneCost, int ironCost, int goldCost,
            String statusDescription, int villageId, int locationX, int locationY, int capacity, int strength, String resourceType,
            int type, String imageUrl) {
        
        this(0, name, level, maxLevel, timeLeft, new int[]{foodCost, woodCost, stoneCost, ironCost, goldCost}, statusDescription, 
                villageId, locationX, locationY, capacity, strength, resourceType, type, imageUrl);        
    }
    
   
    
    public int getBuildingId() {
        return buildingId;
    }

    private void setBuildingId(int buildingId) {
        this.buildingId = buildingId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
    
    public int getMaxLevel() {
        return maxLevel;
    }
    
    public void setMaxLevel(int maxLevel) {
        this.maxLevel = maxLevel;
    }

    public String getStatusDescription() {
        return statusDescription;
    }

    public void setStatusDescription(String status) {
        this.statusDescription = status;
    }

    public int getTimeLeft() {
        return timeLeft;
    }

    public void setTimeLeft(int timeLeft) {
        this.timeLeft = timeLeft;
    }

    public int[] getCost() {
        return cost;
    }

    public void setCost(int cost[]) {
        this.cost = cost;
    }

    public int getVillageId() {
        return villageId;
    }

    public void setVillageId(int villageId) {
        this.villageId = villageId;
    }

    public int getLocationX() {
        return locationX;
    }

    public void setLocationX(int locationX) {
        this.locationX = locationX;
    }

    public int getLocationY() {
        return locationY;
    }

    public void setLocationY(int locationY) {
        this.locationY = locationY;
    }

    public int getCapacity() {
        return capacity;
    }

    public void setCapacity(int capacity) {
        this.capacity = capacity;
    }

    public int getStrength() {
        return strength;
    }

    public void setStrength(int strength) {
        this.strength = strength;
    }

    public String getResourceType() {
        return resourceType;
    }

    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }
    
    public int getType() {
        return type;
    }
    
    public void setType(int type) {
        this.type = type;
    }
    
    public String getImageUrl() {
        return imageUrl;
    }
    
    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }
    
    public int getFoodCost() {
        return this.cost[0];
    }
    
    public int getWoodCost() {
        return this.cost[1];
    }
    
    public int getStoneCost() {
        return this.cost[2];
    }

    public int getIronCost() {
        return this.cost[3];
    }
    
    public int getGoldCost() {
        return this.cost[4];
    }
}
